"use strict";
// 接口
exports.__esModule = true;
{ }
;
var hd = {
    author: '小明',
    title: '小明的文章',
    isLocked: true,
    comments: [{
            time: new Date(),
            person: '小红',
            content: '写的不错'
        }]
};
// 2.接口拓展值与接口继承
var Sex;
(function (Sex) {
    Sex[Sex["gril"] = 0] = "gril";
    Sex[Sex["boy"] = 1] = "boy";
})(Sex || (Sex = {}));
;
var people1 = {
    name: 'xiaohong',
    age: 1,
    sex: Sex.boy,
    color: 'red',
    move: function () {
        console.log(this.name + '----move');
    }
};
people1.move();
;
var person2 = {
    name: 'xiaohong2',
    age: 1,
    sex: Sex.boy,
    hobby: [],
    move: function () {
        console.log(this.name + '----move');
    },
    setHobby: function () {
        var _a;
        var item = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            item[_i] = arguments[_i];
        }
        (_a = this.hobby).push.apply(_a, item);
        return this.hobby;
    }
};
console.log(person2.setHobby('玩电脑', '1', 'abc'));
;
var WxPay = /** @class */ (function () {
    function WxPay() {
    }
    WxPay.prototype.pay = function (price) {
        console.log('微信支付' + price + '元');
    };
    return WxPay;
}());
;
var Alipay = /** @class */ (function () {
    function Alipay() {
    }
    Alipay.prototype.pay = function (price) {
        console.log('支付宝付款' + price + '元');
    };
    return Alipay;
}());
;
function payfn(type) {
    var pay = null;
    switch (type) {
        case '微信':
            pay = new WxPay();
            break;
        case '支付宝':
            pay = new Alipay();
            break;
        default:
            console.log('类型错误');
            break;
    }
    return pay;
}
;
payfn('微信').pay(300);
payfn('支付宝').pay(800);
var p1 = {
    isTrue: false,
    sex: 'body',
    other: 1
};
var p3 = {
    get: function (name) {
        return 'name';
    },
    age: 1,
    sex: 1
};
var p4 = {
    // get(name: string): string {
    //   return 'name';
    // },
    // age: 1,
    sex: 1
};
var per8 = {
    color: null,
    like: 'red'
};
console.log('------------' + JSON.stringify(per8));
